package com.bsh.repository;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Repository;

import com.bsh.mybatis.IRepository.ShareMapper;
import com.bsh.mybatis.model.Share;

@Repository
public class DaoShare {
	@Resource
	SqlSessionTemplate session;

	@Resource
	JdbcTemplate jdbcTemplate;
	@Resource
	NamedParameterJdbcTemplate namedJdbcTemplate;
	
	ShareMapper getMapper(){
		return session.getMapper(ShareMapper.class);
	}
	
	public int insert(Share record) {
		int res = getMapper().insert(record);
		return record.getId();
	}
	
	public int sumTodayTotal(Share record){
		int res=getMapper().sumTodayCloudMoney(record);
		return res;
	}
	
}
